import request from '@/utils/request'

// 查询农民工花名册列表
export function listStaff(query) {
  return request({
    url: '/labour/staff/list',
    method: 'get',
    params: query
  })
}

// 初始化花名册下拉列表数据
export function initSearchSelect(query) {
  return request({
    url: '/labour/staff/initSearchSelect',
    method: 'get',
    params: query
  })
}

// 劳务工工资发放下拉列表
export function dropDownListBySalary(query) {
  return request({
    url: '/labour/staff/dropDownListBySalary',
    method: 'get',
    params: query
  })
}

// 查询农民工花名册详细
export function getStaff(id) {
  return request({
    url: '/labour/staff/' + id,
    method: 'get'
  })
}

// 查询农民工花名册详细
export function browse(id) {
  return request({
    url: '/labour/staff/browse/' + id,
    method: 'get'
  })
}

// 新增农民工花名册
export function addStaff(data) {
  return request({
    url: '/labour/staff',
    method: 'post',
    data: data
  })
}

// 修改农民工花名册
export function updateStaff(data) {
  return request({
    url: '/labour/staff',
    method: 'put',
    data: data
  })
}

// 删除农民工花名册
export function delStaff(id) {
  return request({
    url: '/labour/staff/' + id,
    method: 'delete'
  })
}

// 导出农民工花名册
export function exportStaff(query) {
  return request({
    url: '/labour/staff/export',
    method: 'get',
    params: query
  })
}

// 单个身份证上传
export function cardUpload(data) {
  return request({
    url: '/labour/staff/cardUpload',
    method: 'post',
    data: data
  })
}

// 劳务工进场前信息验证
export function beforeEnterValidate(id) {
  return request({
    url: '/labour/staff/beforeEnterValidate/' + id,
    method: 'get'
  })
}

// 劳务工进场
export function enterStaff(data) {
  return request({
    url: '/labour/staff/enter',
    method: 'post',
    data: data
  })
}

// 劳务工退场
export function exitStaff(data) {
  return request({
    url: '/labour/staff/exit',
    method: 'post',
    data: data
  })
}

// 劳务工批量退场
export function batchExitStaff(data) {
  return request({
    url: '/labour/staff/batchExit',
    method: 'post',
    params: data
  })
}
